//创建固定武器
//加入动态模拟
params ["_pos", "_group"];
private["_veh", "_type"];

if(isNull _group)exitWith{};

private _pos_temp = [];

_pos_temp pushBack ((_pos select 0) + 0);
_pos_temp pushBack ((_pos select 1) + 0);	
_pos_temp pushBack ((_pos select 2) + 0.5);


if(side _group == west) then{
	_type = selectRandom asu_static_b;
}else{
	_type = selectRandom asu_static_g;
};

_veh = createVehicle [_type, [0,0,0] , [], 0, "NONE"];//createSimpleObject [_type, _pos_temp];//
//_veh setDir _dir;
_veh setVehiclePosition [_pos_temp, [], 0, "CAN_COLLIDE"];// setPosATL 


//_veh setVariable["no_cleanup", true];//不被清理标记

//创建乘员
createVehicleCrew _veh;
private _crews = crew _veh; 
{
	[_x] call fn_initUnit;
	[_x] joinSilent _group;
}forEach _crews;
		
if(count _crews > 0 && {random 100 < Param_E_K}) then
{
	[(_crews select 0)] call fn_eventSupport;
}
else
{
	//moveOut (_crews select 0);
	(_crews select 0) leaveVehicle _veh;
};

//禁止绿军玩家使用点的载具
_veh setVariable ["green_disable", true];

//添加事件，红军上车则取消禁用
_veh addEventHandler ["GetIn", {
	params ["_vehicle", "_role", "_unit", "_turret"];
	if(isPlayer _unit && {side _unit == east})then{
		_vehicle setVariable ["green_disable", false];
		_vehicle removeAllEventHandlers "GetIn";
	};
}];

_veh enableDynamicSimulation true;